package WebModule::City;

use strict;

use base qw(WebModule);

__PACKAGE__->meta->setup(
    table   => 'city',

    columns => [
        id  => { type=>'serial', not_null=>1 },
        province => { type=>'integer', not_null=>1 },
        city=>{type=>'varchar', length=>30, not_null=>1 },
        zipcode=>{type=>'varchar', length=>15, not_null=>1 },
        areacode=>{type=>'varchar', length=>15, not_null=>1 },
    ],

    primary_key_columns => [ 'id' ],


    foreign_keys=>[
        province=>{
            class=>'WebModule::Province',
            key_columns=>{ province=>'id'},
        },
    ],

    relationships=>[
        counties=> {
            type=>'one to many',
            class=>'WebModule::County',
            column_map=>{ id=>'city'},
        },
    ]
);

1;

